package Object;

import java.util.Objects;

public class Test {
    public static void main(String[] args) {
        Stu s = new Stu("牛鸡", 18);
        String s1 = "dfdfdf";
        System.out.println(s1.toString()); // 重写toString后输出 Stu{name='牛鸡', age=18}

        Stu s2 = new Stu("牛鸡", 18);
        System.out.println(s2.equals(s)); // 重写equals后输出true
        System.out.println(Objects.equals(s, s2));
    }
}
